import type { App } from 'vue'
import { createPinia } from 'pinia'
import piniaPersist from 'pinia-plugin-persistedstate'
import router from '@/router'

const pinia = createPinia()
// 注册数据持久化插件
pinia.use(piniaPersist)

export { pinia as store }

export default (app: App<Element>) => {
  app.use(pinia)
  app.use(router)
}
